//
//  Original.m
//  LearnObjectiveC
//
//  Created by client on 2017/9/8.
//  Copyright © 2017年 吴可高. All rights reserved.
//

#import "Original.h"
#import "Memento.h"

@implementation Original
@synthesize value;

-(void)setValue:(NSString *)newValue
{
    value = newValue;
}

-(NSString *)value
{
    return value;
}

-(void)originalWithValue:(NSString *)newValue
{
    value = newValue;
}

-(Memento *)createMemento{
    return [[Memento alloc]mementWithValue:value];
}

-(void)restoreMemento:(Memento*)memento;
{
    value = memento.value;
}

@end
